﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL.MySQL;
using Models;
using PetaPoco;

namespace Core
{
    public class toupiaoCore
    {
        private readonly toupiaoDAL dal = new toupiaoDAL();

        public toupiaoEntity GetOne(int id)
        {
            return dal.GetOne(id) == null ? new toupiaoEntity() : dal.GetOne(id);
        }
        public int Update(object obj, int ID)
        {
            return dal.Update(obj, ID);
        }
        public toupiaoEntity Save(toupiaoEntity model)
        {
            return dal.Save(model);
        }
        public bool Del(int id)
        {
            return dal.Del(id);
        }
        public bool Del(toupiaoEntity model)
        {
            return dal.Del(model);
        }
        public List<toupiaoEntity> GetList(string where, string order, params object[] args)
        {
            return dal.GetList( where, order, args);
        }
        public Page<toupiaoEntity> GetPage(int page, int pagesize, string where, string order, params object[] args)
        {
            return dal.GetPageList(page, pagesize, where, order, args);
        }
    }
}
